<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2018/8/16
 * Time: 15:46
 */

namespace app\admin\model;


use think\Model;

class Area extends Model
{
    /**
     * 获取省份
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getProvince(){
        $province = $this->where('level', 1)->select();
        return $province;
    }
    
    /**
     * 获取城市
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getCity($sheng){
        $province = $this->where('pid', $sheng)->select();
        return $province;
    }
    
    /**
     * 获取地区
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getdistrict($shi){
        $province = $this->where('pid', $shi)->select();
        return $province;
    }
}